from system_class import System

def module_set_perms ( liwe, module_name, uid, perms = '', perms_type = 'user' ):
	"""
	:INPUT:
		- module_name:		SAFE_DB_STRING
		- uid:			SAFE_NUMBER
		- perms:		SAFE_DB_STRING
		- perms_type:		SAFE_DB_STRING

	:xPERMS:
		- admin
	"""
	s = System ( liwe )
	return s.module_set_perms ( module_name, uid, perms, perms_type )

def session_dump ( liwe ):
	"""
	:INPUT:
	"""
	return { "session" : liwe.pyhp.session.data }

def modules_check ( liwe ):
	"""
	:INPUT:
	"""
	s = System ( liwe )

	return { "check" : s.modules_check () }


def module_list_config ( liwe, mod_name ):
	"""
	:INPUT:
		- mod_name:	SAFE_DB_STRING
	"""
	s = System ( liwe )
	return { "config" : s.module_list_config ( mod_name ) }

def module_get_all_configs ( liwe ):
	"""
	:INPUT:
	"""
	s = System ( liwe )
	return { "config" : s.module_get_all_configs () }

def module_config_save ( liwe, kwargs ):
	"""
	:INPUT:
	"""
	s = System ( liwe )
	s.module_config_save ( kwargs )
	return { "save" : "OK" }

def tables_settings ( liwe ):
	"""
	:INPUT:
	"""
	s = System ( liwe )
	return { 'tables' : s.tables_settings () }
